import Vue from 'vue';
import Router from 'vue-router';
import login from '@/pages/login';
import index from '@/pages/index/index';
import articleManage from '@/pages/articleManage';
import editArticle from '@/pages/editArticle/editArticle';
import commentManage from '@/pages/commentManage';
import typeManage from '@/pages/typeManage';
import userManage from '@/pages/userManage';
import editUser from '@/pages/editUser';
import typeStatistics from '@/pages/statistics/typeStatistics';
import countStatistics from '@/pages/statistics/countStatistics';
Vue.use(Router);

export default new Router({
    routes: [
        {
            path: '/',
            name: 'Index',
            component: index,
            redirect: '/articleManage',
            children: [
                {
                    path: 'articleManage',
                    name: 'articleManage',
                    component: articleManage,
                    children: [
                        {
                            path: 'editArticle',
                            name: 'editArticle',
                            component: editArticle
                        }
                    ]
                },
                {
                    path: 'commentManage',
                    name: 'commentManage',
                    component: commentManage
                },
                {
                    path: 'typeManage',
                    name: 'typeManage',
                    component: typeManage
                },
                {
                    path: '/typeStatistics',
                    name: 'typeStatistics',
                    component: typeStatistics
                },
                {
                    path: '/countStatistics',
                    name: 'countStatistics',
                    component: countStatistics
                },
                {
                    path: '/userManage',
                    name: 'userManage',
                    component: userManage,
                    children: [
                        {
                            path: 'editUser',
                            name: 'editUser',
                            component: editUser
                        }
                    ]
                }
            ]
        },
        {
            path: '/login',
            name: 'login',
            component: login
        },
        {
            path: '*',
            redirect: '/articleManage'
        }
    ]
});
